package cn.yuanqiao.archive.liyong.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @ProjectName: ruoyi-modules-system
 * @Package: cn.yuanqiao.archive.liyong.mapper
 * @ClassName: ListQueryMapper
 * @Author: lenovo
 * @Description: hbWang
 * @Date: 2023/6/27 11:21
 * @Version: 1.0
 */

@Mapper
public interface ListQueryMapper {

    /**
     * 查询档案门类信息
     *
     * @param
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author hbWang
     * @date 2023/6/20 10:47
     */
    List<Map<String, Object>> selectTableData(@Param("tableName") String tableName, @Param("field") String field, @Param("sql") String sql);

    List<Map<String, Object>> selectUnionALLTableData(@Param("field") String field, @Param("sql") String sql,
                                                      @Param("order") String order, @Param("query") String query,
                                                      @Param("pageeeSize") Integer pageeeSize, @Param("pageeeNum") Integer pageeeNum );

    List<Map<String, Object>> selectUnionALLTableDataPage(@Param("field") String field, @Param("sql") String sql,
                                                          @Param("order") String order, @Param("query") String query);

    List<Map<String, Object>> selectUnionALLTableDataCount(@Param("field") String field, @Param("sql") String sql,
                                                           @Param("order") String order, @Param("query") String query);

    List<Map<String, Object>> selectLeftJoinTableData(@Param("field") String field, @Param("sql") String sql, @Param("tableName") String tableName);

    /**
     * 动态sql 返回单个字段
     *
     * @param tableName
     * @param field
     * @param sql
     * @return
     */
    String selectAppData(@Param("tableName") String tableName, @Param("field") String field, @Param("sql") String sql);


    List<String> selectDataList(@Param("tableName") String tableName, @Param("field") String field, @Param("sql") String sql);

    /**
     * 查询元数据方案
     *
     * @param tableName
     * @return
     */
    List<Map<String, Object>> selectMDataListTableData(@Param("tableName") String tableName, @Param("sql") String sql);

    Map<String, Object> selectUserData(@Param("field") String field, @Param("tableName") String tableName, @Param("id") String id);
}
